package com.binhai.org;

import com.binhai.common.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/org")
public class OrgController extends AbstractController<OrgBean> {
    @Autowired
    private OrgBeanServiceImpl orgBeanService;
    @Override
    public List<OrgBean> selectAllInfos() {
        return orgBeanService.selectAllInfos();
    }

    @Override
    public Map saveOrUpdateInfo(OrgBean orgBean) {
        return orgBeanService.saveOrUpdateInfo(orgBean);
    }

    @Override
    public Map deleteInfo(int id) {
        return orgBeanService.deleteInfo(id);
    }

    @Override
    public OrgBean getInfoById(int id) {
        return orgBeanService.getInfoById(id);
    }

    @Override
    public List<OrgBean> selectInfosByWhere(OrgBean orgBean) {
        return null;
    }

    @RequestMapping("/selectOrgTree.do")
    public List<OrgBean> selectOrgTree() {
        return orgBeanService.selectOrgTree();
    }
}
